<?php


class HeadAssets {
	private $assets;
	private $script;
	
	function style($file,$rel = 'stylesheet', $type = 'text/css') {
		$this->assets = '<link rel="' . $rel . '" type="' . $type . '" href="' . $file . '" />' . "\n";
		return $this->assets;
	}
	
	function addScript($file = false,$js = '',$type = 'text/javascript'){
		if ($js !=''){
			if($file == true){
				$this->script .= '<script type="' . $type . '" src="' . $js . '"></script>' . "\n";
			}
			else{
				$this->script .= $js. "\n";;
			}
			
		}
	}
	
	function display(){
		return $this->script;
	}
	
	function addStyle($file,$rel = 'stylesheet', $type = 'text/css') {
		$this->script .= '<link rel="' . $rel . '" type="' . $type . '" href="' . $file . '" />' . "\n";
		//return $this->assets;
	}

	function script($file,$type = 'text/javascript') {
		$this->assets = '<script type="' . $type . '" src="' . base_url($file) . '"></script>' . "\n";
		return $this->assets;
	}
	
}